Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • vala vala
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 734
    • Issues 734
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • valavala
  • Issues
  • #202

Closed
Open
Created May 15, 2011 by Bugzilla@bugzilla-migration💬Reporter

Type casting notation in definition of a method's arguments

Submitted by car..@..oo.com

Link to original bug (#650226)

Description

It could be convenient to do type casting with notation directly in the function definition. In this example, the "text" property is not defined in Gtk.CellRenderer but it is in subclass Gtk.CellRendererText. Thus a type cast is needed.

/* The delegate. */ public void TreeCellDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter);

/* The callback function, with current enforcements. */ public void my_celldata_func (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) { CellRendererText textcell = (CellRendererText) cell;// This line could be avoided textcell.text = "my dynamic text"; textcell.font = "Bitstream Vera Sans 10"; }

/* The callback function with suggested casting for the "cell" argument. */ public void my_celldata_func (TreeViewColumn tree_column, CellRenderer cell as CellRendererText, TreeModel tree_model, TreeIter iter) { cell.text = "my dynamic text"; cell.font = "Bitstream Vera Sans 10"; }

Version: 0.12.x

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking